Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightning: Don't log "received task config" in server mode #52336

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

kennytm
Copy link
Contributor

@kennytm kennytm commented Apr 3, 2024

What problem does this PR solve?

Issue Number: close #36374

Problem Summary:

What changed and how does it work?

Lightning in server-mode logged the original TOML task config received in POST /task. This will leak password of the task into the log. Previously #36375 attempted to workaround by replacing the password part by ****** with regexp, but the regexp is written wrongly. Even if it is regexp is corrected, using regexp to parse TOML is bound to miss some edge cases.

This PR simply removed the log. If the task config can be successfully parsed, it should still be visible in the subsequent [cfg] log with proper redaction.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    • run in server-mode and send a config
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

Fix the issue that sensitive information in logs is still printed in server mode.

@kennytm kennytm added type/bugfix This PR fixes a bug. component/lightning This issue is related to Lightning of TiDB. labels Apr 3, 2024
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 3, 2024
Copy link

tiprow bot commented Apr 3, 2024

Hi @kennytm. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kennytm kennytm requested a review from lance6716 April 3, 2024 07:53
@kennytm
Copy link
Contributor Author

kennytm commented Apr 3, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Apr 3, 2024
@kennytm kennytm force-pushed the fix-36374-for-real branch from c7d8d95 to 4158c58 Compare April 3, 2024 08:00
@kennytm kennytm force-pushed the fix-36374-for-real branch from 4158c58 to 7f6728f Compare April 3, 2024 08:17
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Merging #52336 (7f6728f) into master (970962b) will increase coverage by 1.9212%.
Report is 8 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52336        +/-   ##
================================================
+ Coverage   72.1377%   74.0590%   +1.9212%     
================================================
  Files          1467       1467                
  Lines        426674     429240      +2566     
================================================
+ Hits         307793     317891     +10098     
+ Misses        99710      91496      -8214     
- Partials      19171      19853       +682     
Flag Coverage Δ
integration 48.6612% <ø> (?)
unit 70.9612% <ø> (-0.0604%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 49.1005% <ø> (+8.5195%) ⬆️

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 3, 2024
@lance6716 lance6716 requested a review from lyzx2001 April 3, 2024 09:02
Copy link

ti-chi-bot bot commented Apr 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, lyzx2001

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 3, 2024
Copy link

ti-chi-bot bot commented Apr 3, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-03 09:02:28.326147222 +0000 UTC m=+434609.853687768: ☑️ agreed by lance6716.
  • 2024-04-03 13:35:06.035815537 +0000 UTC m=+450967.563356080: ☑️ agreed by lyzx2001.

@ti-chi-bot ti-chi-bot bot merged commit 555ce02 into pingcap:master Apr 3, 2024
23 checks passed
@kennytm kennytm deleted the fix-36374-for-real branch April 3, 2024 21:44
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Apr 11, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Apr 11, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #52497.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #53069.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 7, 2024
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. label Jun 4, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #53771.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved component/lightning This issue is related to Lightning of TiDB. lgtm needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiDB-Lightning will print some sensitive message when it runs in server mode
4 participants